export function getChart1Option() {
  return {
    grid: {
      left: "5%",
      right: "5%",
      bottom: "8%"
    },
    xAxis: {
      type: "category",
      data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
    },
    yAxis: [
      {
        name: "吨",
        type: "value"
      },
      {
        type: "value",
        name: "计划执行率",
        min: 0,
        max: 100,
        axisLabel: {
          formatter: "{value} %"
        }
      }
    ],
    tooltip: {
      trigger: "item"
    },
    legend: {},
    series: [
      {
        name: "发货量",
        data: [120, 200, 150, 80, 70, 110, 130],
        type: "bar",
        stack: "stack1",
        yAxisIndex: 0,
        label: {
          show: true,
          position: "top",
          formatter: params => params.value + "吨"
        },
        color: "#6e9bf5",
        barWidth: "30%",
        z: 10
      },
      {
        name: "计划量",
        data: [120, 200, 150, 80, 70, 110, 130].map(item => (item += 66)),
        type: "bar",
        stack: "stack2",
        yAxisIndex: 0,
        label: {
          show: true,
          position: "top",
          formatter: params => params.value + "吨"
        },
        color: "#dddddd",
        barWidth: "30%",
        z: 5,
        barGap: "-100%",
        stackStrategy: "positive"
      },
      {
        name: "计划执行率",
        type: "line",
        yAxisIndex: 1,
        data: [20, 40, 60, 80, 75, 45, 91],
        label: {
          show: true,
          position: "top",
          formatter: params => params.value + "%"
        },
        z: 100,
        markLine: {
          silent: false,
          lineStyle: {
            normal: {
              color: "red" // 这儿设置安全基线颜色
            }
          },
          label: {
            normal: {
              formatter: "时间进度：75%", // 这儿设置安全基线,
              position: "end",
              color: "red",
              lineHeight: 30
            }
          },
          data: [{ yAxis: 75, name: "基准线",symbol:'none' },{yAxis: 75,symbol: 'circle',name: "基准线",}],
          z: 110
        }
      }
    ]
  };
}
export function getChart2Option() {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow"
      }
    },
    legend: {
      show: false
    },
    grid: {
      top: "3%",
      left: "3%",
      right: "4%",
      bottom: "0%",
      containLabel: true
    },
    xAxis: {
      type: "value",
      show:false
    },
    yAxis: {
      type: "category",
      data: ["计划量", "销售量", "可发货量", "发货量"],
      axisLine: { show: false },
      axisTick: { show: false },
      splitLine: { show: false }
    },
    series: [
      {
        name: "2011",
        type: "bar",
        data: [18203, 23489, 29034, 104970],
        label: {
          show: true,
          position: "insideLeft",
          color: "#fff"
        },
        color: "#73a0fa"
      }
    ]
  };
}
export function getChart3Option() {
  return  {
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    icon:'rect'
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '0%',
    containLabel: true
  },
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    axisTick: { alignWithLabel:true },
    boundaryGap:true,
    axisLabel: {
      show: true,
      color: '#c8c8c8',
      formatter: (params)=>{
        return `${params}\n\n nb666\n nbPlus\n`
      },
      align : 'center'
    }
  },
  yAxis: {
    name:'单位：吨',
    type: 'value'
  },
  series: [
    {
      name: '可发货量',
      type: 'line',
      data: [120, 132, 101, 134, 90, 230, 210]
    },
    {
      name: '月发货量',
      type: 'line',
      data: [220, 182, 191, 234, 290, 330, 310]
    },
    {
      name: '销售量',
      type: 'line',
      data: [150, 232, 201, 154, 190, 330, 410]
    },
    {
      name: '发货量',
      type: 'line',
      data: [320, 332, 301, 334, 390, 330, 320]
    },
  ]
};
}
export function getChart4Option() {
  return  {
    title:{
      text:'汇总'
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: {
      type: 'category',
      data: ['月计划量', '销售量', '可发货量', '发货量'],
      axisTick: { show: false }
    },
    yAxis: {
      name:'单位：吨',
      type: 'value'
    },
    series: [
      {
        data: [120, 200, 150, 80, 70, 110, 130],
        type: 'bar',
        barWidth: '20'
      }
    ]
  };
}